package com.sinoair.web.pkm;

import com.sinoair.web.FileUploadController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * layuiDemo
 * ${desc}
 * <pre>
 *  Version         Date            Author          Description
 * ---------------------------------------------------------------------------------------
 *  1.0.0           2017/09/09     senlin        -
 * </pre>
 *
 * @author senlin
 * @version 1.0.0 2017/9/9 0009 22:59
 * @date 2017/9/9 0009 22:59
 * @since 1.0.0
 */
@Controller
public class PKMManagerController {

    protected static Logger logger = LoggerFactory.getLogger(PKMManagerController.class);


    //示例用于kindeditor显示
    @RequestMapping("/demo/kindeditor/edit")
    public ModelAndView getArticle(@RequestParam String id) {
        logger.info("显示Kindeditor的页面……");
        ModelAndView mv = new ModelAndView();
        mv.setViewName("/plugins/kindeditor/demo");
        String htmlData = "<DIV>设置图标缓存解决桌面文件或图标太多，刷新桌面图标速度慢问题 </DIV>\n" +
                "<DIV><IMG alt=\"\"\"\" src=\"\"20101229133042757.gif\"\"> 由 楚林 撰写 | 2010-07-10 发表在 <A title=查看所有【资料共享】的日志 href=\"\"http://www.clxp.net.cn/default.asp?cateID=3\"\">资料共享</A> 分类中，推荐度：<IMG alt=\"\"\"\" src=\"\"20101229133042321.gif\"\"> | 评论: 1 | 查看次数: 2359 <A accessKey=O title=订阅所有【资料共享】的日志 href=\"\"http://www.clxp.net.cn/feed.asp?cateID=3\"\" target=_blank>RSS</A> <INPUT onclick=copyToClipBoard() value=复制本文链接 type=button name=Submit ?>\n" +
                "<SCRIPT language=javascript>\n" +
                "   function copyToClipBoard(){\n" +
                "    var clipBoardContent=\"\"\"\";\n" +
                "    clipBoardContent+=document.title;\n" +
                "    clipBoardContent+=\"\"\\n\"\";\n" +
                "    clipBoardContent+=this.location.href;\n" +
                "    window.clipboardData.setData(\"\"Text\"\",clipBoardContent);\n" +
                "    alert(\"\"复制成功，请粘贴到你的QQ/MSN上推荐给你的好友!\"\");\n" +
                "  }\n" +
                "  </SCRIPT>\n" +
                " </DIV>\n" +
                "<DIV>\n" +
                "<DIV></DIV></DIV>\n" +
                "<DIV id=logPanel>把下面注册表导入下就好了，原理是修改图标缓存为4MB……以前没试过，今天试了下，爽歪……<BR>\n" +
                "<DIV codePanel?>\n" +
                "<DIV><A onclick=copycode(code62833);>复制内容到剪贴板</A><IMG alt=程序代码 src=\"\"20101229133042829.gif\"\"> 程序代码</DIV>\n" +
                "<DIV id=code62833>Windows Registry Editor Version 5.00<BR><BR>[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer]<BR>\"\"Max Cached Icons\"\"=\"\"4096\"\"</DIV></DIV><BR><BR></DIV>\n";
        mv.addObject("htmlData", htmlData);
        return mv;
    }


    //示例用于kindeditor显示
    @ResponseBody
    @RequestMapping("/demo/kindeditor/save")
    public String saveContent(@RequestParam String content1) {

        logger.info(content1);
        logger.info("保存成功");
        return "OK";

    }


}
